﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LoginTest.aspx.cs" Inherits="TestWeb.LoginTest" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>FormsAuthentication DEMO</title>
</head>
<body>
    <fieldset><legend>普通登录</legend>
        <form id="form1" runat="server">
        登录名：<input type="text" name="loginName" style="width: 200px" value="Test" />&nbsp;
        <asp:Button ID="LoginBtn" runat="server" Text="登录" onclick="LoginBtn_Click" />
    </fieldset>     
    
    <fieldset><legend>用户状态</legend>
        <% if( Request.IsAuthenticated ) { %>
            当前用户已登录，登录名：<%= Context.User.Identity.Name %> <br />
            
            <% var user = Context.User as FeCMS.AccessControlModule.Security.FeFormsPrincipal;  %>
            <% if( user != null ) { %>
                <%= user.UserData.ToString() %>            
            <% } %>

            <asp:Button ID="OutBtn" runat="server" Text="登出" onclick="OutBtn_Click" />
        <% } else { %>
            <b>当前用户还未登录。</b>
        <% } %>            
    </form></fieldset>    
    
    <p id="hideText"><i>不应该显示的文字</i></p>
</body>
</html>
